<template>
	<view>
		<unio2o-tab @select="selectTab" :tabs="tabs" :selectIndex="selectIndex"></unio2o-tab>
		
		<scroll-view class="member-coupon-scroll" scroll-y="true">
			<view v-if="selectIndex == 0" class="pd30">
				<view class="mb50">
					<unio2o-coupon-item :showStore="false"></unio2o-coupon-item>
					
				</view>
				<view class="mb50">
					<unio2o-coupon-item></unio2o-coupon-item>
				</view>
				<view class="mb50">
					<unio2o-coupon-item></unio2o-coupon-item>
				</view>
				<view class="mb50">
					<unio2o-coupon-item></unio2o-coupon-item>
				</view>
			</view>
			<view v-if="selectIndex == 1" class="pd30">
				<view class="mb50">
				<unio2o-coupon-used  :showStore="false"></unio2o-coupon-used>
				</view>
				<view class="mb50">
					<unio2o-coupon-used></unio2o-coupon-used>
				</view>
			</view>
			<view v-if="selectIndex == 2" class="pd30">
				<view class="mb50">
					<unio2o-coupon-expire :showStore="false"></unio2o-coupon-expire>
				</view>
				<view class="mb50">
					<unio2o-coupon-expire></unio2o-coupon-expire>
				</view>
			</view>
		</scroll-view>
		
		<view v-if="isEmpty"  class="unio2o-empty bg-w">
			<view class="flex center">
				<image  :src="''"></image>
			</view>
			<view class="text-center mt30 ft14 text-notice">暂无优惠券</view>
		</view>
	</view>
</template>

<script>
	import unio2oTab from '@/components/base/tab/tab.vue';
	import unio2oCouponItem from '@/components/module/coupon/myitem.vue';
	import unio2oCouponUsed  from '@/components/module/coupon/used.vue';
	import unio2oCouponExpire from '@/components/module/coupon/expire.vue';
	export default {
		components:{
			unio2oTab,
			unio2oCouponItem,
			unio2oCouponUsed,
			unio2oCouponExpire
		},
		data(){
			return {
				isEmpty:false,
				selectIndex:0,
				tabs:[
					{name:'未使用'},
					{name:'已使用'},
					{name:'已过期'}
				]
			}
		},
		methods:{
			selectTab(e){
				let index =parseInt(e);
				this.selectIndex = index;
			}
		}
	}
</script>

<style>
	.unio2o-empty{
		height: calc(100vh - 104rpx);
		padding-top: 200rpx;
	}
	.unio2o-empty image{
		width: 240rpx;
		height: 240rpx;
	}
	.member-coupon-scroll{
		height: calc(100vh - 104rpx);
	}
</style>